home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_11_09
/
1109086a
< prev
next >
Wrap
Text File
|
1993-07-06
|
1KB
|
39 lines
sun_vaddosb(vect_in1,incr_in1,vect_in2,incr_in2,
vect_out,incr_out,vect_length)
float *vect_in1, *vect_in2, *vect_out;
int vect_length, incr_in1, incr_in2, incr_out;
{
register float tmp,
tmp_1,
tmp_2;
if((incr_in1 == 1) && (incr_in2 == 1) && (incr_out == 1))
{
while(vect_length--)
{
tmp_1 = *vect_in1++;
tmp_2 = *vect_in2++;
tmp = tmp_1 - tmp_2;
*vect_out++ = (tmp_1 + tmp_2) / tmp;
}
}
else
{
while(vect_length--)
{
tmp_1 = *vect_in1;
tmp_2 = *vect_in2;
tmp = tmp_1 - tmp_2;
*vect_out = (tmp_1 + tmp_2) / tmp;
vect_in1 += incr_in1;
vect_in2 += incr_in2;
vect_out += incr_out;
}
}
}